package com.atguigu.guli.service.base.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.lang.reflect.Field;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author: jinlu
 * @Date: 2022/2/13
 * @Time: 15:32
 * @Version:
 */
@Data
//@Accessors用于配置getter和setter方法的生成结果,chain设置为true，则setter方法返回当前对象
@Accessors(chain = true)
public class BaseEntity {

    @ApiModelProperty(value = "ID")
    @TableId(value = "id" , type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "创建时间" , example = "2022-01-01 10:00:00")
    @TableField(fill = FieldFill.INSERT , value = "gmt_create")
    private Date gmtCreate;

    @ApiModelProperty(value = "更新时间", example = "2022-01-01 10:00:00")
    @TableField(fill = FieldFill.INSERT_UPDATE , value = "gmt_modified")
    private Date gmtModified;
}
